import java.util.*;
public class TableOrder extends Observable implements  Runnable {
	
	//set true when times stops auction
	private boolean finished = false;
	
//	private MVCAuctionView view;
	private Set <FoodOrder> OrderList;
	ArrayList <FoodOrder> abc;
	Orders o;
	//Thread kitchenThreads;

	//////////////////////////////////////////////////////////
	//CONSTRUCTOR creates list of customers
	public TableOrder() {
	//	abc.addAll(o);

	}
	///////////////////////////////////////////////////////////
	//returns whether restaurant is closed or not
	public boolean isFinished() {
		return finished;
	}
	
	//indicates close of restaurant
	public void setFinished() {
		finished = true;

	}
	

	//thread run method
	//starts off each customer thread for bidding
	//then sleeps until auction is over
	//finally sets variable to show auction is over
	public void run() {
		//start a separate timer for the auction
 	

	//kitchenThreads = new Thread();
   	//kitchenThreads.start();
    	//for (FoodOrder foodOrder : OrderList){
    	try {
    		Thread.sleep(5000);
    		System.out.println("helloooo");
    		//sendOneOrder();
    	}
		catch (Exception e) {
			System.out.println("TableOrder thread exception" + e.getStackTrace());
	//	}
    	}
    	//System.out.println("Finishing");
    	//finished = true;
	}
	
	
	public synchronized void sendOneOrder() {
		
		for(FoodOrder fo : abc)
		{
			System.out.println(fo.getItem());
		}
		
		
		//update view display
		setChanged();
		notifyObservers();
    	clearChanged();

	}
}
